﻿using System;
using System.Net;

namespace Esponce.QRCode
{
	public class QRCodeException : Exception
	{
		public QRCodeException(int code, string message, string hint = null) : base(message)
		{
			this.ErrorCode = code;
			this.Hint = hint;
		}

		/// <summary>
		/// Gets or sets API-specific error code to identify the problem.
		/// </summary>
		public int ErrorCode
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets hint how to solve the problem.
		/// </summary>
		public string Hint
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets HTTP status code from response, e.g. 404
		/// </summary>
		public HttpStatusCode StatusCode
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets HTTP status description from response, e.g. "Not Found"
		/// </summary>
		public string StatusDescription
		{
			get;
			set;
		}
	}
}
